let eventEmiter = {
    list: {
        "article": []
    },
    on(event, fn) {
        this.list[event].push(fn);
    },
    emit(event, title) {
        this.list[event].forEach(fn => {
            fn(title)
        })
    }
}
function user1 (content) {
    console.log('用户1订阅了',content)
}
function user2 (content) {
    console.log('用户2订阅了',content)
}
eventEmiter.on('article', user1);
eventEmiter.on('article', user2);
setTimeout(() => {
    eventEmiter.emit('article','JavaScript内容')
},1000)